<html>
    <head>
        <script src="jquery-3.3.1.js"></script>
        <script>
        $(function(){
         console.log($("#div1").html());
         console.log( $(".divClass"));
         console.log($("p[name = 'p1']"));
             $("#div4 > p").css("background-color","red");
             $("#div4  p").css("background-color","yellow");
        console.log($("#city :last").html());
        console.log($("#city :first").html());
        console.log($("#city :gt(1)"));
        console.log($("#city :lt(1)"));
        console.log($("option:selected").val())
        console.log($(".hobby1:checked").val())
        }
        )
        </script>
    </head>
    <body>
        <div id="div1">div1</div>
        <div id="div2">div2</div>
        <div class="divClass">div3</div>
        <div name ="p1">1234</div>
        <div id="div4">div4
        <p name="p1">123</p>
        <div id="div5">
        <p id="p2">456</p>
         

               <select  id="city">
                  <option >北京</option>
                  <option selected value="1">上海</option>
                  <option >南京</option>
                  <option >广州</option>
               </select>
               <br>
               <input type="checkbox" name="hobby" class="hobby1" value="1" checked>篮球
               <input type="checkbox" name="hobby" class="hobby1" value="2">足球


    </body>
</html>